﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace WpfA1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            rcarray[0] = tt1;
            rcarray[1] = tt2;
            rcarray[2] = tt3;
            rcarray[3] = tt4;
            rcarray[4] = tt5;
            rcarray[5] = tt6;
              

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            DoubleAnimation daX = new DoubleAnimation();
            DoubleAnimation daY = new DoubleAnimation();

            //BounceEase be = new BounceEase();
            //be.Bounces = 10;
            //be.Bounciness = 10;
            //daY.EasingFunction = be;

            daX.AccelerationRatio = 1;
            
            
            daX.To=600;
 //           daY.To=300;
            
            Duration duration = new Duration(TimeSpan.FromMilliseconds(1000));
            daX.Duration = duration;
            daY.Duration = duration;

           
          //  Card0 card = new Card0();
            this.rcarray[i].BeginAnimation(TranslateTransform.XProperty, daX);
            i++;
            if (i ==4)
            {
                this.richTextBox1.Visibility = Visibility.Hidden;
                daX.To = 0;
                this.rcarray[0].BeginAnimation(TranslateTransform.XProperty, daX);
                //this.richTextBox1.SetValue(Canvas.LeftProperty, (double)-200);
                //richTextBox1.GetValue(Canvas.LeftProperty);
                i = 0;
            //    this.richTextBox1.Visibility = Visibility.Visible;
            }
            
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            DoubleAnimation daX = new DoubleAnimation();
            DoubleAnimation daY = new DoubleAnimation();

            //BounceEase be = new BounceEase();
            //be.Bounces = 10;
            //be.Bounciness = 10;
            //daY.EasingFunction = be;

            daX.AccelerationRatio = 1;


            daX.To = 10;
            //           daY.To=300;

            Duration duration = new Duration(TimeSpan.FromMilliseconds(1000));
            daX.Duration = duration;
            daY.Duration = duration;


            //card.richTextBox1.BeginAnimation(TranslateTransform.XProperty, daX);
            //card.richTextBox1.BeginAnimation(TranslateTransform.YProperty, daY);
        }

        private TranslateTransform  [] rcarray = new TranslateTransform[6];
        private int i = 0;
    }
}
